{% extends 'base.html' %}

{% block title %}康普惠 | 破界而生、循道而行{% endblock %}

{% block head %}
<style>
    .fade-in-up {
        opacity: 0;
        transform: translateY(20px);
        transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    }
    
    .fade-in-up.visible {
        opacity: 1;
        transform: translateY(0);
    }
    
    .guide-img-container {
        width: 60px;
        height: 60px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }
    
    .guide-card {
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .guide-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
    }
    
    /* 在页面加载后触发动画效果 */
    @media (prefers-reduced-motion: no-preference) {
        .banner-content h1 {
            animation: fadeInUp 1s ease-out forwards;
        }
        
        .banner-content p {
            animation: fadeInUp 1.2s ease-out forwards;
        }
        
        .banner-content .btn {
            animation: fadeInUp 1.4s ease-out forwards;
        }
    }
    
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    /* 字体优化样式 */
    .banner-title {
        text-shadow: 0 2px 4px rgba(0,0,0,0.4);
        letter-spacing: -0.02em;
        font-weight: 600;
    }
    
    .section-title {
        letter-spacing: -0.01em;
        font-weight: 700;
    }
    
    .testimonial-text {
        font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
        line-height: 1.8;
        letter-spacing: 0.01em;
        font-size: 1rem;
    }
    
    .guide-card h4 {
        font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
        font-weight: 600;
    }
    
    /* 5卡片布局优化 */
    @media (min-width: 1200px) {
        .guide-section .col-lg-4:nth-child(4) {
            margin-left: 16.666%;
        }
        .guide-section .col-lg-4:nth-child(5) {
            margin-right: 16.666%;
        }
    }
    
    @media (max-width: 991px) {
        .guide-section .col-md-6:nth-child(5) {
            margin: 0 auto;
            max-width: 50%;
        }
    }
    
    @media (max-width: 767px) {
        .guide-section .col-md-6 {
            max-width: 100% !important;
            margin: 0 !important;
        }
    }
</style>
{% endblock %}

{% block content %}
{% load static %}
<!-- 轮播图横幅 -->
<section class="hero-slider">
    <div id="heroCarousel" class="carousel slide carousel-fade" data-bs-ride="carousel" data-bs-interval="5000">
        <div class="carousel-indicators">
            {% for banner in banners %}
                <button type="button" data-bs-target="#heroCarousel" data-bs-slide-to="{{ forloop.counter0 }}" {% if forloop.first %}class="active" aria-current="true"{% endif %} aria-label="Slide {{ forloop.counter }}"></button>
            {% empty %}
                <button type="button" data-bs-target="#heroCarousel" data-bs-slide-to="0" class="active" aria-current="true" aria-label="Slide 1"></button>
                <button type="button" data-bs-target="#heroCarousel" data-bs-slide-to="1" aria-label="Slide 2"></button>
            {% endfor %}
        </div>
        
        <div class="carousel-inner">
            {% for banner in banners %}
                <div class="carousel-item {% if forloop.first %}active{% endif %}">
                    <div class="carousel-image-container">
                    <img src="{{ banner.image.url }}" class="d-block w-100" alt="{{ banner.title }}">
                        <div class="carousel-overlay"></div>
                    </div>
                    <div class="carousel-caption">
                        <div class="caption-content">
                            <h2 class="banner-title">{{ banner.title }}</h2>
                            {% if banner.subtitle %}<p class="banner-subtitle">{{ banner.subtitle }}</p>{% endif %}
                            {% if banner.button_text and banner.link %}
                                <a href="{{ banner.link }}" class="btn btn-primary banner-btn">{{ banner.button_text }}</a>
                            {% endif %}
                        </div>
                    </div>
                </div>
            {% empty %}
                <div class="carousel-item active">
                    <div class="carousel-image-container">
                    <img src="{% static 'img/shouye/1.jpeg' %}" class="d-block w-100" alt="康普惠">
                        <div class="carousel-overlay"></div>
                    </div>
                    <div class="carousel-caption">
                        <div class="caption-content">
                            <h2 class="banner-title">破界而生、循道而行</h2>
                            <p class="banner-subtitle">为您的业务提供专业的咨询和解决方案</p>
                            <a href="{% url 'contact' %}" class="btn btn-primary banner-btn">联系我们</a>
                        </div>
                    </div>
                </div>
                <div class="carousel-item">
                    <div class="carousel-image-container">
                    <img src="{% static 'img/shouye/3.jpeg' %}" class="d-block w-100" alt="康普惠">
                        <div class="carousel-overlay"></div>
                    </div>
                    <div class="carousel-caption">
                        <div class="caption-content">
                            <h2 class="banner-title">专业咨询，品质服务</h2>
                            <p class="banner-subtitle">提供定制化解决方案，满足您的企业需求</p>
                            <a href="{% url 'consulting_product' 'strategic_planning' %}" class="btn btn-primary banner-btn">咨询产品</a>
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>
        
        <button class="carousel-control-prev" type="button" data-bs-target="#heroCarousel" data-bs-slide="prev">
            <span class="carousel-control-prev-icon" aria-hidden="true"></span>
            <span class="visually-hidden">上一个</span>
        </button>
        <button class="carousel-control-next" type="button" data-bs-target="#heroCarousel" data-bs-slide="next">
            <span class="carousel-control-next-icon" aria-hidden="true"></span>
            <span class="visually-hidden">下一个</span>
        </button>
    </div>
</section>


<!-- 导航引导区 -->
<section class="guide-section py-5">
    <div class="container">
        <div class="row justify-content-center">
            <div class="col-12 text-center mb-5">
                <h2 class="section-title position-relative d-inline-block pb-2">探索我们的解决方案</h2>
                <p class="section-subtitle text-muted mt-3">携手康普惠，为您的企业创造更美好的未来</p>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-4 col-md-6 mb-4">
                <div class="guide-card h-100 shadow-sm rounded overflow-hidden">
                    <div class="guide-card-img">
                        <img src="{% static 'img/shouye/2.jpeg' %}" alt="战略规划系统" class="w-100">
                        <div class="overlay-dark"></div>
                    </div>
                    <div class="guide-card-body p-4">
                        <h4 class="mb-3 text-primary">战略规划系统</h4>
                        <p class="mb-3">制定清晰的战略目标和发展路径，应对市场变化和挑战，让战略真正落地执行。</p>
                        <a href="{% url 'consulting_product' 'strategic_planning' %}" class="btn-link d-inline-flex align-items-center">
                            <span>了解更多</span>
                            <i class="bi bi-arrow-right ms-2"></i>
                        </a>
                    </div>
                </div>
            </div>
            <div class="col-lg-4 col-md-6 mb-4">
                <div class="guide-card h-100 shadow-sm rounded overflow-hidden">
                    <div class="guide-card-img">
                        <img src="{% static 'img/shouye/7.jpg' %}" alt="组织智能系统" class="w-100">
                        <div class="overlay-dark"></div>
                    </div>
                    <div class="guide-card-body p-4">
                        <h4 class="mb-3 text-primary">组织智能系统</h4>
                        <p class="mb-3">优化组织结构，提升组织效能，建立高效的管理模式和运营机制，助力企业战略落地。</p>
                        <a href="{% url 'consulting_product' 'organization_intelligence' %}" class="btn-link d-inline-flex align-items-center">
                            <span>了解更多</span>
                            <i class="bi bi-arrow-right ms-2"></i>
                        </a>
                    </div>
                </div>
            </div>
            <div class="col-lg-4 col-md-6 mb-4">
                <div class="guide-card h-100 shadow-sm rounded overflow-hidden">
                    <div class="guide-card-img">
                        <img src="{% static 'img/shouye/4.jpg' %}" alt="岗位优化系统" class="w-100">
                        <div class="overlay-dark"></div>
                    </div>
                    <div class="guide-card-body p-4">
                        <h4 class="mb-3 text-primary">岗位优化系统</h4>
                        <p class="mb-3">精准定位岗位职责和要求，优化人力资源配置，提升工作效率和组织协同能力。</p>
                        <a href="{% url 'consulting_product' 'position_optimization' %}" class="btn-link d-inline-flex align-items-center">
                            <span>了解更多</span>
                            <i class="bi bi-arrow-right ms-2"></i>
                        </a>
                    </div>
                </div>
            </div>
            <div class="col-lg-4 col-md-6 mb-4">
                <div class="guide-card h-100 shadow-sm rounded overflow-hidden">
                    <div class="guide-card-img">
                        <img src="{% static 'img/shouye/6.jpg' %}" alt="薪酬激励系统" class="w-100">
                        <div class="overlay-dark"></div>
                        </div>
                    <div class="guide-card-body p-4">
                        <h4 class="mb-3 text-primary">薪酬激励系统</h4>
                        <p class="mb-3">吸引、保留和激励高绩效人才，建立合理的薪酬体系和激励机制，提升人才管理效能。</p>
                        <a href="{% url 'consulting_product' 'salary_incentive' %}" class="btn-link d-inline-flex align-items-center">
                            <span>了解更多</span>
                            <i class="bi bi-arrow-right ms-2"></i>
                        </a>
                    </div>
                </div>
            </div>
            <div class="col-lg-4 col-md-6 mb-4">
                <div class="guide-card h-100 shadow-sm rounded overflow-hidden">
                    <div class="guide-card-img">
                        <img src="{% static 'img/shouye/8.jpg' %}" alt="绩效提升系统" class="w-100">
                        <div class="overlay-dark"></div>
            </div>
                    <div class="guide-card-body p-4">
                        <h4 class="mb-3 text-primary">绩效提升系统</h4>
                        <p class="mb-3">设计科学的绩效管理体系，促进企业战略目标实现，激发员工潜能，提升组织绩效。</p>
                        <a href="{% url 'consulting_product' 'performance_improvement' %}" class="btn-link d-inline-flex align-items-center">
                            <span>了解更多</span>
                            <i class="bi bi-arrow-right ms-2"></i>
                        </a>
                    </div>
                </div>
                </div>
        </div>
    </div>
</section>




<!-- 特色服务 -->
<section class="features-section section">
    <div class="container">
        <div class="text-center mb-5">
            <h2 class="section-title d-inline-block mx-auto animate-on-scroll fade-in-up">我们的优势</h2>
            <p class="section-subtitle animate-on-scroll fade-in-up">为什么选择康普惠</p>
        </div>
        
        <div class="row">
            <div class="col-lg-3 col-md-6 mb-4 animate-on-scroll fade-in-up">
                <div class="feature-item text-center p-4">
                    <div class="feature-icon mb-3">
                        <i class="bi bi-graph-up-arrow display-4 text-primary"></i>
                    </div>
                    <h4>专业洞察</h4>
                    <p>深入行业分析，提供前瞻性战略建议</p>
                </div>
            </div>
            
            <div class="col-lg-3 col-md-6 mb-4 animate-on-scroll fade-in-up" style="animation-delay: 0.2s;">
                <div class="feature-item text-center p-4">
                    <div class="feature-icon mb-3">
                        <i class="bi bi-person-workspace display-4 text-primary"></i>
                    </div>
                    <h4>资深团队</h4>
                    <p>拥有来自知名企业的行业专家</p>
                </div>
            </div>
            
            <div class="col-lg-3 col-md-6 mb-4 animate-on-scroll fade-in-up" style="animation-delay: 0.4s;">
                <div class="feature-item text-center p-4">
                    <div class="feature-icon mb-3">
                        <i class="bi bi-gear display-4 text-primary"></i>
                    </div>
                    <h4>定制方案</h4>
                    <p>根据客户需求量身定制专属解决方案</p>
                </div>
            </div>
            
            <div class="col-lg-3 col-md-6 mb-4 animate-on-scroll fade-in-up" style="animation-delay: 0.6s;">
                <div class="feature-item text-center p-4">
                    <div class="feature-icon mb-3">
                        <i class="bi bi-check-circle display-4 text-primary"></i>
                    </div>
                    <h4>落地执行</h4>
                    <p>确保方案有效落地，实现持续发展</p>
                </div>
            </div>
        </div>
    </div>
</section>




<!-- 联系我们 CTA -->
<section class="cta-section py-5 bg-primary text-white text-center">
    <div class="container py-4">
        <div class="row justify-content-center">
            <div class="col-lg-8 animate-on-scroll fade-in-up">
                <h2 class="mb-4 fw-bold">准备好开始您的业务转型之旅了吗？</h2>
                <p class="lead mb-4">康普惠咨询专注于为企业提供专业、高效的管理咨询服务，助力企业实现可持续发展</p>
                <a href="{% url 'contact' %}" class="btn btn-light btn-lg">立即联系我们</a>
            </div>
        </div>
    </div>
</section>

<style>
/* 动画效果 */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-right {
    opacity: 0;
    transform: translateX(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible, 
.fade-in-left.visible, 
.fade-in-right.visible, 
.fade-in-up.animated, 
.fade-in-left.animated, 
.fade-in-right.animated {
    opacity: 1;
    transform: translate(0, 0);
}

/* 卡片悬停效果 */
.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

/* 洞察内容样式 */
.insight-content {
    border-left: 4px solid #0d6efd;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.insight-icon i {
    display: inline-block;
    padding: 15px;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 50%;
}
</style>

{% endblock %}

{% block extra_js %}
<script>
document.addEventListener('DOMContentLoaded', function() {
    // 初始化轮播图
    var myCarousel = document.getElementById('heroCarousel');
    var carousel = new bootstrap.Carousel(myCarousel, {
        interval: 5000,
        wrap: true,
        touch: true
    });
    
    // 数字计数器动画
    function animateCounters() {
        document.querySelectorAll('.count-up').forEach(function(counter) {
            const target = parseInt(counter.getAttribute('data-count'));
            const duration = 2000; // 动画持续2秒
            const step = target / duration * 10; // 每10毫秒更新一次
            
            let current = 0;
            const timer = setInterval(function() {
                current += step;
                counter.textContent = Math.floor(current);
                
                if (current >= target) {
                    counter.textContent = target;
                    clearInterval(timer);
                }
            }, 10);
        });
    }
    
    // 检测元素是否进入视口的函数
    function isElementInViewport(el) {
        const rect = el.getBoundingClientRect();
        return (
            rect.top <= (window.innerHeight || document.documentElement.clientHeight) &&
            rect.bottom >= 0
        );
    }
    
    // 当元素进入视口时触发计数器动画
    function checkCounters() {
        const statsSection = document.querySelector('.stats-section');
        if (statsSection && isElementInViewport(statsSection)) {
            animateCounters();
            window.removeEventListener('scroll', checkCounters);
        }
    }
    
    // 初始检查和滚动监听
    checkCounters();
    window.addEventListener('scroll', checkCounters);
    
    // 淡入动画效果
    const animateElements = document.querySelectorAll('.animate-on-scroll');
    
    const observer = new IntersectionObserver((entries) => {
        entries.forEach(entry => {
            if (entry.isIntersecting) {
                let delay = 0;
                if (entry.target.dataset.delay) {
                    delay = parseInt(entry.target.dataset.delay);
                }
                setTimeout(() => {
                    entry.target.classList.add('animated');
                }, delay);
            }
        });
    }, { threshold: 0.1 });
    
    animateElements.forEach(element => {
        observer.observe(element);
    });
});
</script>
{% endblock %} 